package com.qf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.support.MultipartFilter;

import java.io.File;
import java.io.IOException;

/**
 * @author TZL
 * @date 2020/8/7
 */
@Controller
public class MyController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        System.out.println("开整");
        return "hello 啊";
    }


    @RequestMapping("/up")
    @ResponseBody
    public String upload(MultipartFile file) throws IOException {
        System.out.println("开始上传了！！");
        file.transferTo(new File("d:/"+file.getOriginalFilename()));
        return "上传成功！";
    }




}
